<template>
  <el-form inline="true" label-position="right" ref="form" :model="form" label-width="100px">
    <el-form-item label="表名">
    <el-input v-model="form.tableName"></el-input>
  </el-form-item>
  <el-form-item label="方法名称">
    <el-input v-model="form.methodName"></el-input>
  </el-form-item>
  <el-form-item label="方法描述">
    <el-input v-model="form.methodDescription"></el-input>
  </el-form-item>
  <el-form-item label="参数描述">
    <el-input v-model="form.paramDescription"></el-input>
  </el-form-item>
  <el-form-item label="参数名称">
    <el-input v-model="form.paramName"></el-input>
  </el-form-item>
  <el-form-item label="参数类型">
    <el-input v-model="form.paramType"></el-input>
  </el-form-item>
  <el-form-item label="返回类型">
    <el-input v-model="form.returnType"></el-input>
  </el-form-item>
  <el-form-item label="是否是类">
    <!-- <div class="formLeft"> -->
      <el-checkbox v-model="form.isClass">是</el-checkbox>
    <!-- </div> -->
  </el-form-item>
  <el-form-item label="请求类型">
    <div class="formLeft">
    <el-select v-model="form.requestType" placeholder="请选择请求类型">
      <el-option label="get" value="1"></el-option>
      <el-option label="post" value="2"></el-option>
    </el-select>
    </div>
  </el-form-item>

  <el-form-item>
    <el-button type="primary" @click="onSubmit">立即创建</el-button>
    <el-button>取消</el-button>
  </el-form-item>
</el-form>
</template>

<script>
import axios from "axios";
  export default {
    data() {
      return {
        form: {
          tableName:'',
          methodName: '',
          methodDescription: '',
          paramDescription: '',
          paramName: '',
          paramType: "",
          returnType: "",
          isClass: true
        }
      }
    },
    methods: {
      onSubmit() {
        axios
        .post("https://localhost:44328/api/Code/AddMethod", this.form)
        .then(function (response) {
          console.log(response);
        })
        .catch(function (error) {
          console.log(error);
        });
      }
    }
  }
</script>
<style>
.el-form-item__content{
  width:400px;
  text-align: left;
}
.el-form-item{
  width:500px;
}
</style>